package com.neo.pub.service.impl;

import com.neo.common.annotation.DataSource;
import com.neo.common.enums.DataSourceType;
import com.neo.common.exception.pub.PhyscialExamPatientDuplicateException;
import com.neo.common.exception.pub.PhyscialExamPatientNotExistException;
import com.neo.common.exception.pub.PhyscialExamPatientSearchException;
import com.neo.pub.domain.Patient;
import com.neo.pub.domain.PhysicalExamPatient;
import com.neo.pub.mapper.PatientMapper;
import com.neo.pub.mapper.PhysicalExamPatientMapper;
import com.neo.pub.service.IPatientService;
import com.neo.pub.service.IPhysicalExamPatientService;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 用户 业务层处理
 * 
 * @author tr
 */
@Service
@DataSource(value = DataSourceType.SLAVE)
public class PhysicalExamPatientServiceImpl implements IPhysicalExamPatientService
{
    private static final Logger log = LoggerFactory.getLogger(PhysicalExamPatientServiceImpl.class);

    @Autowired
    private PhysicalExamPatientMapper physicalExamPatientMapper;

    @Override
    public List<PhysicalExamPatient> selectPatientList(PhysicalExamPatient physicalExamPatient) {
        return physicalExamPatientMapper.selectPatientList(physicalExamPatient);
    }

    @Override
    public PhysicalExamPatient selectPatientByCode(PhysicalExamPatient physicalExamPatient){
        return physicalExamPatientMapper.selectPatientByCode(physicalExamPatient);
    }

    @Override
    public int selectPatientCountByCode(PhysicalExamPatient physicalExamPatient) {
        return physicalExamPatientMapper.selectPatientCountByCode(physicalExamPatient);
    }

    @Override
    @Transactional
    public int updatePatientStatus(PhysicalExamPatient physicalExamPatient) throws PhyscialExamPatientSearchException {
        return physicalExamPatientMapper.updatePatientStatus(physicalExamPatient);
    }





}
